package com.example.service.Impl;

import com.example.dao.UserDAO;
import com.example.entity.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 夏虫言冰
 * @date 2021/5/4 14:18
 */
@Service
@Transactional
public class UserviceImpl implements UserService {

    @Autowired
    private UserDAO userDAO;

    @Override
    public User login(User user) {
        User login = userDAO.login(user);
        if (login!=null){
            return login;
        }
        throw new RuntimeException("登录失败");
    }
}
